// _form/element/checkbox/index.js
const { c0 } = getApp()
Component({
    behaviors: ['wx://form-field-group'],
    options:{
        virtualHost: true
    },
    properties: {
        name: String,
        value: null,
        disabled: Boolean,
        color: null,
        checkbox: null
    },
    data: {
        c0
    },
    methods: {
        change(){
            let { value } = this.data
            value = !(value * 1)
            this.setData({ value  })
            this.triggerEvent('change', value ? '1' : '0')
        }
    }
})
